<div class="sc-cnt-publicacao">
        
   
    <div class="content-tb nowid e-cnt-men">
        <div class="tl-pag">Lista de Testes</div>
        
        <table class="nrmprd">          
        <?php foreach($this->result as $key => $row){ ?>
            <tr>
                <td style="width: 120px">
                    <?php echo $row['PUL_NOM']; ?>
                </td>    
                <td style="width: 200px">
                    <div class="lst_exe_inf">
                        Encerramento<br/>
                        <span class="inf_txt">
                            <?php echo substr(Datetools::invertDH_D($row['PUL_DATENC']),0,5); ?> 
                        </span>
                        &nbsp; às &nbsp; 
                        <span class="inf_txt">
                            <?php echo Datetools::hora_hm($row['PUL_HORENC']); ?>
                        </span>
                    </div>
                </td>
                <td style="width: 100px" align="center">
                    <div class="lst_exe_inf">
                        Status<br/>
                        <span class="inf_txt">
                        <?php
                            if($row['PUL_STA'] == 1) echo 'Aberta';
                            else if($row['PUL_STA'] == 2) echo 'Encerrada';
                        ?>
                        </span>
                    </div>
                </td>
            </tr>
            <?php if($row['PUL_STA'] == 2){ 
                
            ?>
            <tr>
                <td colspan="4">
                    <span class="icn_exp_cont rot90" itemid="<?php echo $row['PUL_ID']?>"></span> Resultado
                    <table class="lst_res_tb cntsubitem-<?php echo $row['PUL_ID']?>">
                        <tr>
                            <td>Questão</td>
                            <td>Porcentagem</td>
                            <td>Respostas</td>
                            <td>Acertos</td>
                        </tr>
                        <?php
                        $query = 'SELECT SQL_CACHE p.*,d.DCP_NOM ' 
                               .' FROM PUBLST_QSTDIS p, DISCIPLINA d '
                               .' WHERE p.DCP_ID = d.DCP_ID AND p.PUL_ID = '.$row['PUL_ID']
                               .' AND p.DCP_ID = '.$this->professor['DCP_ID']
                               .' ORDER BY p.PQD_QST';
                        $disc = $this->db->fetchAll($query);
                        foreach($disc as $dis){ ?>
                        <tr>
                            <td align="center"><?php echo $dis['PQD_QST']; ?></td>
                            <td align="center">
                                <?php echo $dis['PQD_POR']; ?>%
                            </td>
                            <td align="center">
                                <?php echo $dis['PQD_TOT']; ?>
                            </td>
                            <td align="center">
                                <?php echo $dis['PQD_ACR']; ?>
                            </td>
                        </tr>
                        <?php } ?>
                    </table>
                </td>
            </tr>

            
            <?php } ?>
        <?php
            if($row['PUL_STA'] == 1) $status = $row['PUL_STA'];
            } ?>
        </table>
    </div>
    
</div>
<?php
if($status == 1) echo '<script> setInterval(function(){ window.location.href = URLBASE+\'/\'+CONTROL; }, 60000); </script>'; 
?>
<?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>
 
